function userInfoForm() {
    $.ajax({
        url: '/my/userinfo',
        method: 'GET',
        success: function(res) {
            // console.log(res);
            layui.form.val('user_info_form', res.data)
        }
    });
};
userInfoForm();
// 提交功能
$('.layui-form').on('submit', function(e) {
    e.preventDefault();
    $.ajax({
        url: '/my/userinfo',
        method: 'POST',
        data: $(this).serialize(),
        success: function(res) {
            console.log(res);
            layer.msg(res.message);
            userInfoForm();
            window.parent.getUserInfo();
        }
    });
});
// 重置功能
$('.reset').on("click", function() {
    userInfoForm();
});